﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace contactusform.web
{
    public class ContactViewModel
    {
        [Required(ErrorMessage = "The First Name field is required")]
        [DataType(DataType.Text)]
        public string FirstName { get; set; }

        [Required(ErrorMessage = "The Last Name field is required")]
        [DataType(DataType.Text)]
        public string LastName { get; set; }

        [DataType(DataType.PhoneNumber)]
        [RegularExpression(@"^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$", ErrorMessage = "Entered telephone format is not valid.")]
        public string Telephone { get; set; }

        [Required(ErrorMessage = "The email address field is required")]
        [DataType(DataType.EmailAddress)]
        [EmailAddress(ErrorMessage = "Invalid Email Address")]
        public string EmailAddress { get; set; }

        [DataType(DataType.DateTime)]
        public DateTime? BestTimeToCall { get; set; }

    }

}